PUT
/
1
/
indexes
/
{indexName}
/
synonyms
/
{objectID}
curl --request PUT \
  --url https://{appId}.algolia.net/1/indexes/{indexName}/synonyms/{objectID} \
  --header 'Content-Type: application/json' \
  --header 'x-algolia-api-key: <api-key>' \
  --header 'x-algolia-application-id: <api-key>' \
  --data '{
  "objectID": "synonymID",
  "type": "onewaysynonym",
  "synonyms": [
    "vehicle",
    "auto"
  ],
  "input": "car",
  "word": "car",
  "corrections": [
    "vehicle",
    "auto"
  ],
  "placeholder": "<Street>",
  "replacements": [
    "street",
    "st"
  ]
}'
{
  "taskID": 1514562690001,
  "updatedAt": "2023-07-04T12:49:15Z",
  "id": "12"
}

Authorizations

x-algolia-application-id
string
header
required

Your Algolia application ID.

x-algolia-api-key
string
header
required

Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.

Path Parameters

indexName
string
required

Name of the index on which to perform the operation.

Example:

"ALGOLIA_INDEX_NAME"

objectID
string
required

Unique identifier of a synonym object.

Example:

"synonymID"

Query Parameters

forwardToReplicas
boolean

Whether changes are applied to replica indices.

Body

application/json

Synonym object.

Response

200
application/json

OK

The response is of type object.